<template>
	<view class="container">
		<u-sticky offset-top="0">
			<view class="search-box">
				<u-search placeholder="请输入搜索内容" v-model="searchValue"></u-search>
			</view>
		</u-sticky>

		<view class="alarms">
			<view class="alarm" v-for='(it,index) in 24' @click="handleNavToDetail(it)" :key="index">
				<view class="alarm-t">
					<text class="title">孩子丢失</text>
					<u-tag text="紧急" plain plainFill type="warning"></u-tag>
				</view>
				<view class="alarm-c">
					因天气原因，滕王阁景点暂时关闭因天气原因，滕王阁景点暂时关闭因天气原因，滕王阁景点暂时关闭因天气原因，滕王阁景点暂时关闭因天气原因，滕王阁景点暂时关闭因天气原因，滕王阁景点暂时关闭
				</view>
				<view class="alarm-b">

					<view class="address">
						<u-icon name="map" color="#666" size="20"></u-icon>
						景区位置
					</view>
					<view class="p">
						<text class="person">张女士</text>
						<text class="time">
							2024-09-03 12:33:44
						</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchValue: ''
			};
		},
		methods: {
			handleNavToDetail() {
				uni.navigateTo({
					url: '/pages/earlyWarningPage/earlyWarningDetail/earlyWarningDetail'
				})
			}
		},
		onReachBottom() {
			console.log(111)
		}
	}
</script>

<style lang="scss">
	.search-box {
		padding: 22upx 30upx;
		box-sizing: border-box;
		background-color: #fff;
	}


	.alarms {
		padding: 0 30upx;
		box-sizing: border-box;

		.alarm {
			padding: 22upx 30upx;
			box-sizing: border-box;
			border: 1upx solid $uni-border-color;
			border-radius: 12upx;
			position: relative;
			background-color: #fff;
			margin-bottom: 22upx;

			&:before {
				content: '';
				border-radius: 12px;
				background-color: orange;
				width: 100%;
				height: calc(100%);
				position: absolute;
				top: 0;
				z-index: -1;
				left: -16upx;
			}

			.alarm-t {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.title {
					font-size: 32upx;
				}
			}

			.alarm-c {
				font-size: 30upx;
				color: $uni-text-color-grey;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				line-height: 1.6;
				-webkit-line-clamp: 2;
				overflow: hidden;
				margin: 12upx 0;
			}

			.alarm-b {
				display: flex;

				.address {
					display: flex;
					align-items: center;
					font-size: 28upx;
					color: $uni-text-color-sub;
				}

				.p {
					font-size: 28upx;
					color: $uni-text-color-sub;
					margin-left: auto;

					.person {
						margin-right: 8upx;
					}

					.time {}
				}
			}
		}
	}
</style>